UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'SSa9+ckv0F+zhlUf2HGAY62IgX7Rk0Flc9vkBfRmDnk='
WHERE
key_id = 'e6f1fe5ec3cb8d33e780e816e2a6756984064d4dc07fb8b6c488c0fa9149ba5b'
AND (
token = 'SSa9+ckv0F+zhlUf2HGAY62IgX7Rk0Flc9vkBfRmDnk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)