UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+xUtTGD1ZVePsIrdlLUwofaATnKU8Galub9S8QHxEss=' 
WHERE 
  key_id = 'b4e02a4481da05afc23c07f8ef4e0e3c8a107fcf51f47a8ce1b676f86cd04c88' 
  AND (
    token = '+xUtTGD1ZVePsIrdlLUwofaATnKU8Galub9S8QHxEss=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00054