UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ooVzuXMzBHZRgD90vrBKTrwypoxhB14Gis+oprvDEq4='
WHERE
key_id = 'e75193a101d883ab89e2016965d71bc4fc75fa024fe1cb8b32ae03ad97529059'
AND (
token = 'ooVzuXMzBHZRgD90vrBKTrwypoxhB14Gis+oprvDEq4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)