UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'dFHKxySgOhpOX9qBDc7bWhbCkPzV+GG10nFdqE+h7Fc='
WHERE
key_id = '80ef8322602c889ca20406d1ec869657c055fc99dce563f2d9c213c26d32be00'
AND (
token = 'dFHKxySgOhpOX9qBDc7bWhbCkPzV+GG10nFdqE+h7Fc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)