UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'LgTFUDwkvMKNuZ9a9/NQ7IqREcn1TMJkFrxRzGR+BDQ='
WHERE
key_id = 'e682e6b3f66b57068526be807f9d34dac125a2aab0daca172fd96bdc8598bd5f'
AND (
token = 'LgTFUDwkvMKNuZ9a9/NQ7IqREcn1TMJkFrxRzGR+BDQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)