UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'cZLiIaJCRZyAefm6FTz7Q88K7W7nE51b2iNS2G7B6/I='
WHERE
key_id = '444c62d5cfcb388a43111f0537c0699e919fc601397edcac4f5f339f668886ca'
AND (
token = 'cZLiIaJCRZyAefm6FTz7Q88K7W7nE51b2iNS2G7B6/I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)