UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'bBHNE1k9PjgHNEkvcgSnfm2cFeG56av8dFWsfwh3CHg='
WHERE
key_id = '8b2cee76dd44e244c744dbab1d91b17a296eb19dbc1654cd32eec6516f73ff1f'
AND (
token = 'bBHNE1k9PjgHNEkvcgSnfm2cFeG56av8dFWsfwh3CHg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)