UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'mhDVlFRusSFjSN01TqBtrC1E3OvSyOeOlE7dqF72uSQ='
WHERE
key_id = '42368165e1a341da203f3e52ccb9e1fdc3f9d02e6f439daeeb359f23475307cd'
AND (
token = 'mhDVlFRusSFjSN01TqBtrC1E3OvSyOeOlE7dqF72uSQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)