UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'vPJmqWwSmF1ctWxtASwWBajM/d8jSmCVqQyO5WygWyE='
WHERE
key_id = '09bd327e9571e25ee01333e3bf28cc3dada0f8148130f787b5f7c4d3205d6a38'
AND (
token = 'vPJmqWwSmF1ctWxtASwWBajM/d8jSmCVqQyO5WygWyE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)