UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'lU1FX57Y1dPSaxsejOA0NWSKQZdE7VS2xztJ5AHwd5o='
WHERE
key_id = 'ac9d09cb41f43c0fbbe9f8963129d811a09babb8c0cdadd60d00e2e6663d66f1'
AND (
token = 'lU1FX57Y1dPSaxsejOA0NWSKQZdE7VS2xztJ5AHwd5o='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)