UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'OCvoUFZFFEDIt160W2o5L8glCSSkXdD5Q8xdD1YPg8w='
WHERE
key_id = '4e985cb8f9239835cb8dfd443953a303fcd0613cd5956c4f02f2e327aad01dc7'
AND (
token = 'OCvoUFZFFEDIt160W2o5L8glCSSkXdD5Q8xdD1YPg8w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)