UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'SSLS2vC/3i5HLLkJdyKv3FHHVkpvIo7gc0hCMOC/TW4='
WHERE
key_id = '5a72de5e35fba0495a97070923a8ac69f04f4b8e9318872ba9f54b7df6897fed'
AND (
token = 'SSLS2vC/3i5HLLkJdyKv3FHHVkpvIo7gc0hCMOC/TW4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)