UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'X5GbmNDnZRSaVdH0yIcqq6K6P/ix/YMiIWb4PNGx56k=' 
WHERE 
  key_id = 'e75440745732c625e558db486d4fd205cffe3458a17700dfe05725d37518a71a' 
  AND (
    token = 'X5GbmNDnZRSaVdH0yIcqq6K6P/ix/YMiIWb4PNGx56k=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039