UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'qgoEmBPpY7XRsick6Z1GITEVboVY8+dBqjkOJyF/tIo=' 
WHERE 
  key_id = '0d72e72e840112f6f94daf98b31eed174ce393594800ecdff747f9f205462bf2' 
  AND (
    token = 'qgoEmBPpY7XRsick6Z1GITEVboVY8+dBqjkOJyF/tIo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044