UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vx0M4FcZRlyq+HTLVvEVPj0KZ5FdtKrtqCLCYq6r2vY=' 
WHERE 
  key_id = 'ce81599735d69cdd7baaa0a0ef0ef1ea095bf28ff5d69611d7be1ab503eb4170' 
  AND (
    token = 'vx0M4FcZRlyq+HTLVvEVPj0KZ5FdtKrtqCLCYq6r2vY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038