UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2egjaEh0lFbDUcOf9cOnlUl5BS6OZ5k/l0emKy1H/H8='
WHERE
key_id = '5de5fef6959338fe24f294b1db693cfc4ca389d7976975c90edb0011447560ee'
AND (
token = '2egjaEh0lFbDUcOf9cOnlUl5BS6OZ5k/l0emKy1H/H8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)