UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hBliSwCEbQjnPhnu6cb+AxNwguznnsmjfPxEwfUgmKI='
WHERE
key_id = '92f57644107b95091c3f1060b560ed43af4db34175992e7bc4fc1353c6bfd037'
AND (
token = 'hBliSwCEbQjnPhnu6cb+AxNwguznnsmjfPxEwfUgmKI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)