UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '61lESP9xPcnjuqVMZ8EvBUAMDsUxYNKjZJcvmq/LGzU=' 
WHERE 
  key_id = '5e20e041b2c295982b4579faab4d6b9fa85cf4e524352e1576a6860828ee2666' 
  AND (
    token = '61lESP9xPcnjuqVMZ8EvBUAMDsUxYNKjZJcvmq/LGzU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016