UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'GA83iZFeyLld6+5mcrNE5ae9gw5rvWj51XoNkiBzJ0Y='
WHERE
key_id = '86d019102b57c5b156ac2c94e2b8351bece260776827d1028d01e132e1ee4f8d'
AND (
token = 'GA83iZFeyLld6+5mcrNE5ae9gw5rvWj51XoNkiBzJ0Y='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)