UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9Syh68cmZkpq/IbaJiVxM4IN0PRvCMfnpkqIValD9nI='
WHERE
key_id = '0f506125b0c7d7e3bb4f05a3cc223baeae29413135102346899a239d0b1c24ef'
AND (
token = '9Syh68cmZkpq/IbaJiVxM4IN0PRvCMfnpkqIValD9nI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)