UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'k2Rr4ddeQnXsa/Fpoh9h1uYo2EuwflSCiWg1uT9mR6U='
WHERE
key_id = 'b8df44d0bbfcacdc4e207559a9744cdc71aedb5b3ec34c520c13a870bdf9b224'
AND (
token = 'k2Rr4ddeQnXsa/Fpoh9h1uYo2EuwflSCiWg1uT9mR6U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)