UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'VC8nKSVFsfPP8SERHHkCEGwuGBa/dr267Q8LxtfFHT8='
WHERE
key_id = '3d019e7861e1f18c032b299d9a823e0addf3408450b5ccf4338a52b360e707f2'
AND (
token = 'VC8nKSVFsfPP8SERHHkCEGwuGBa/dr267Q8LxtfFHT8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)