UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'VMMPCXAXermJ0t7whhp4UVx8Tzr6zepsi6mpW6O9lmk='
WHERE
key_id = '3763a8a81fc514bf50a32ab667203de9590f6e5395ab1ab487ee290a139688c3'
AND (
token = 'VMMPCXAXermJ0t7whhp4UVx8Tzr6zepsi6mpW6O9lmk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)