UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '686UkKyfgMHCQPKeuHBCKEVBS7K5R7dlG/hgsnXrYcg='
WHERE
key_id = '7458e216fffc1b31f1974afe2c11fe4192e47a85bc4ec3363f48aae8ea40812f'
AND (
token = '686UkKyfgMHCQPKeuHBCKEVBS7K5R7dlG/hgsnXrYcg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)