UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3zdYlQdjpeBmhoUomvUSQosqJdalw32xZNl9DwsE2jE='
WHERE
key_id = 'e744c615e56d7898e941973f361cb35169365ae68408245e9b760c12fbe5bac5'
AND (
token = '3zdYlQdjpeBmhoUomvUSQosqJdalw32xZNl9DwsE2jE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)