UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+1PXTKbPQee+pqOMyC6CYCTxIdp+ZgCvCSvQWx3y2KE=' 
WHERE 
  key_id = '8e781ad8c0d9b863378d3e31792116aba5c49d219956012d48acb69c3e2c2179' 
  AND (
    token = '+1PXTKbPQee+pqOMyC6CYCTxIdp+ZgCvCSvQWx3y2KE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028