UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Lt6xErbQQeBGwA09q/lTdTipKQcCRfynLoWgGQNPj6s='
WHERE
key_id = 'f9a9fc25c8b4b9088f2413d57fcdaa033ca670e1b21dbc7217667bbf8494cd16'
AND (
token = 'Lt6xErbQQeBGwA09q/lTdTipKQcCRfynLoWgGQNPj6s='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)