UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0oohc6Tgoyk+k1v2SwCkUUKRt5z3Ig4Iur2plIRNMLs=' 
WHERE 
  key_id = 'f3b7df9fce46cb946263e1483073cf058c0c47471e2b33dab98db6f9b26cf6ec' 
  AND (
    token = '0oohc6Tgoyk+k1v2SwCkUUKRt5z3Ig4Iur2plIRNMLs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00047