UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ZLs8dOv5UYbD0BfTx/Xn9lNVovsyaNCGW/3/VfWufAg=' 
WHERE 
  key_id = 'd279d243ba216f31ffcfc21330dbeb649e0cd7c506c86daf7c8fd0f183488f7f' 
  AND (
    token = 'ZLs8dOv5UYbD0BfTx/Xn9lNVovsyaNCGW/3/VfWufAg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027