UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ippIs6qFaPIzJZeZwp+INDr35vbu5AzNtMepYWjeavw='
WHERE
key_id = '0930ee90f7dfefb7ee81e31ccf4605c54c7587d2ab61b6d1e9310860308a06f4'
AND (
token = 'ippIs6qFaPIzJZeZwp+INDr35vbu5AzNtMepYWjeavw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)