UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '5Lyr473+PI1ySAhz82quNU00thBLpoU3rmROJ/5Lj7o=' 
WHERE 
  key_id = '7b9a672d3ae2ddd0e60f8dcfb197e95bb284217ea413428374e53db5cc12bee5' 
  AND (
    token = '5Lyr473+PI1ySAhz82quNU00thBLpoU3rmROJ/5Lj7o=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00051