UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'kcJyKEQt0YbJtrH9GON7qp0n6qb324E35Gxc6xSJp6U='
WHERE
key_id = '6532934f24f59d24d566a7eaf7702b734ff54006ce466b22bfa86bcdb4d4a135'
AND (
token = 'kcJyKEQt0YbJtrH9GON7qp0n6qb324E35Gxc6xSJp6U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)