UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'NOO3YOzGuShQqt9kzRKuJS1V0ND4qr++wFYr/m8SgF8='
WHERE
key_id = '6a873f28e0bc776498b814c8f322eff3b3d8cf137a09e582e19032220f26831c'
AND (
token = 'NOO3YOzGuShQqt9kzRKuJS1V0ND4qr++wFYr/m8SgF8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)